The attached study plots the date (see green square in picture) correctly over the first bar of each day but I would like for it to plot on the first bar of the next day. In other words, if today is the 24th then on the first bar of today the plot would be data for the 23rd.
Any help would be appreciated.
Wayne
Any help would be appreciated.
Wayne
PHP Code:
function preMain(){
setPriceStudy(true);
}
function main(){
var xTime = getValue("time");
var xFstBarIndxDay = getFirstBarIndexOfDay(xTime);
var xDate = xTime.getDate();
if(getBarState() == BARSTATE_NEWBAR) {
drawShapeAbsolute( xFstBarIndxDay, close(0), Shape.SQUARE , null, Color.RGB(31,200,19), Shape.TOP | Shape.ONTOP );
drawTextAbsolute( xFstBarIndxDay, close(0), xDate, Color.yellow, Color.RGB(31,200,19), Text.ONTOP | Text.CENTER, "Courier New", 8 );
}
}
Comment